﻿using Bot.Domain.Entities;
using Bot.Domain.Interfaces;
using Bot.Domain.Specifications;
using Castle.Windsor;
using Comm100.Framework.Domain.Repository;
using System;
using System.Collections.Generic;
using System.Text;

namespace Bot.Domain.Services
{
    public class AgentAssistLearningQuestionDomainService : IAgentAssistLearningQuestionDomainService
    {
        private IWindsorContainer _container;
        private readonly IRepository<Guid, AgentAssistLearningQuestion> _repository;

        public AgentAssistLearningQuestionDomainService(IRepository<Guid, AgentAssistLearningQuestion> repository, IWindsorContainer container)
        {
            this._repository = repository;
            this._container = container;
        }

        public AgentAssistLearningQuestion Create(AgentAssistLearningQuestion question)
        {
            return _repository.Create(question);
        }

        public AgentAssistLearningQuestion Get(Guid id)
        {
            var result = _repository.Get(id);            
            return result;
        }
        public int Count(AgentAssistLearningQuestionFilterSpecification spec)
        {
            return _repository.Count(spec);
        }
        public IEnumerable<AgentAssistLearningQuestion> List(AgentAssistLearningQuestionFilterSpecification spec)
        {            
            return _repository.List(spec);            
        }

        public void Delete(Guid id)
        {
            if (_repository.Exists(id))
            {
                AgentAssistLearningQuestion learningQuestion = _repository.Get(id);

                _repository.Delete(learningQuestion);
            }
        }

    }
}
